package Day3Zuoye;

    public class Company {
    String cname;
    String address;
    String telephone;
    String fanwei;
    int pos=0;//当前人数
    Yuangong []yuangong=new Yuangong[10];
public boolean add(Yuangong yuan){
    if (pos >=yuangong.length ) {
        System.out.println("人已经满了！");
        return false;
    } else {
        for (int i = 0; i < pos; i++) {
            if (yuangong[i].equals(yuan)) {
                return true;
            }
    }
        yuangong[pos++] = yuan;
    }
    return false;
}

}

